﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt
{
	// Token: 0x020000A0 RID: 160
	public class TDropDatabaseStmt : TCustomSqlStatement
	{
		// Token: 0x060004FE RID: 1278 RVA: 0x002FC65B File Offset: 0x002FA85B
		public TObjectNameList getDatabaseNameList()
		{
			return this.databaseNameList;
		}

		// Token: 0x060004FF RID: 1279 RVA: 0x002FC663 File Offset: 0x002FA863
		public TObjectName getDatabaseName()
		{
			return this.databaseName;
		}

		// Token: 0x06000500 RID: 1280 RVA: 0x002FC66B File Offset: 0x002FA86B
		public TDropDatabaseStmt(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstdropdatabase;
		}

		// Token: 0x06000501 RID: 1281 RVA: 0x002FC680 File Offset: 0x002FA880
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			if (this.rootNode is TDummy)
			{
				TDummy tdummy = (TDummy)this.rootNode;
				if (tdummy.node1 != null)
				{
					this.databaseName = (TObjectName)tdummy.node1;
				}
				else if (tdummy.objectNameList != null)
				{
					this.databaseNameList = tdummy.objectNameList;
					this.databaseName = this.databaseNameList.getObjectName(0);
				}
			}
			else
			{
				TDropDatabaseSqlNode tdropDatabaseSqlNode = (TDropDatabaseSqlNode)this.rootNode;
				this.databaseNameList = tdropDatabaseSqlNode.getDatabaseNameList();
				this.databaseName = tdropDatabaseSqlNode.getDatabaseName();
				if (this.databaseName == null && this.databaseNameList != null)
				{
					this.databaseName = this.databaseNameList.getObjectName(0);
				}
			}
			return 0;
		}

		// Token: 0x06000502 RID: 1282 RVA: 0x002FC742 File Offset: 0x002FA942
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000503 RID: 1283 RVA: 0x002FC752 File Offset: 0x002FA952
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000504 RID: 1284 RVA: 0x002FC762 File Offset: 0x002FA962
		public void setDatabaseName(TObjectName databaseName)
		{
			this.databaseName = databaseName;
		}

		// Token: 0x0400112C RID: 4396
		private TObjectName databaseName;

		// Token: 0x0400112D RID: 4397
		private TObjectNameList databaseNameList;
	}
}
